Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(store): add TS store events/ABI, move around exports #1034

Merged
merged 3 commits into from
Jun 15, 2023

Conversation

holic
Copy link
Member

@holic holic commented Jun 15, 2023

(pulled out of #1033)

Moves codegen into its own build/export, because we can't import from @latticexyz/store in the browser due to a node-only dependency, and I want to colocate TS definition of store events near the Solidity where they're defined.

Once codegen got moved out, it felt a little weird that config was in "library" still, so I moved that out too, and then there wasn't much left, so I just got rid of the notion of "library" (which won't make much sense anyway once #1025 is done and "register" is removed)

@holic holic marked this pull request as ready for review June 15, 2023 05:00
@holic holic requested a review from alvrs as a code owner June 15, 2023 05:00
@holic holic requested a review from dk1a June 15, 2023 05:00
@holic holic changed the title refactor(store): move around exports feat(store): add TS store events/ABI, move around exports Jun 15, 2023
"event StoreSetField(bytes32 table, bytes32[] key, uint8 schemaIndex, bytes data)",
"event StoreSetRecord(bytes32 table, bytes32[] key, bytes data)",
"event StoreEphemeralRecord(bytes32 table, bytes32[] key, bytes data)",
] as const;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the main thing I wanted to import from another package into the browser bundle

dk1a
dk1a previously approved these changes Jun 15, 2023
Copy link
Contributor

@dk1a dk1a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice restructure, I prefer this regardless of #1025

Comment on lines 23 to 24

const sortedStoreEventsAbi = storeEventsAbi.slice().sort((a, b) => a.name.localeCompare(b.name));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slice() feels unintuitive as a way to copy an array, [...storeEventsAbi] would be immediately clear, to me at least

@changeset-bot
Copy link

changeset-bot bot commented Jun 15, 2023

⚠️ No Changeset found

Latest commit: 6adc044

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants